package com.runtime.hongyunuser.service;

import com.runtime.hongyunuser.bean.Products;
import com.runtime.hongyunuser.bean.Shoppingcarts;
import com.runtime.hongyunuser.bean.vo.CartProductVO;

import java.util.List;

public interface ShoppingcartsService {
    // 添加商品到购物车
    Shoppingcarts addToCart(Long userId, Long productId, Long quantity);

    // 获取用户购物车
    List<Shoppingcarts> getCartItems(Long userId);

    // 更新购物车项数量
    void updateQuantity(Long cartId, Integer quantity);

    // 删除购物车项
    void removeFromCart(Long userId, Long productId);

    // 清空用户购物车
    void clearCart(Long userId);

    List<Products> getProductInfoFromCart(List<Shoppingcarts> cartItems);

    int removeBatchFromCart(Long userId, List<Long> cartIds);

    List<CartProductVO> getCartProductsByUserId(Long userId);
}